package com.xujie.property_warranty_system.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 设施设备实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("facilities")
public class Facility {
    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 设备编号
     */
    @TableField("facility_code")
    private String facilityCode;
    
    /**
     * 设备名称
     */
    @TableField("facility_name")
    private String facilityName;
    
    /**
     * 所在位置
     */
    @TableField("location")
    private String location;
    
    /**
     * 设备类型
     */
    @TableField("facility_type")
    private String facilityType;
    
    /**
     * 制造商
     */
    @TableField("manufacturer")
    private String manufacturer;
    
    /**
     * 购买日期
     */
    @TableField("purchase_date")
    private LocalDate purchaseDate;
    
    /**
     * 保修期限(月)
     */
    @TableField("warranty_period")
    private Integer warrantyPeriod;
    
    /**
     * 设备状态：1-正常，2-维修中，3-报废
     */
    @TableField("status")
    private Integer status;
    
    /**
     * 负责人
     */
    @TableField("responsible_person")
    private String responsiblePerson;
    
    /**
     * 联系电话
     */
    @TableField("contact_phone")
    private String contactPhone;
    
    /**
     * 设备描述
     */
    @TableField("description")
    private String description;
    
    /**
     * 维护周期(天)
     */
    @TableField("maintenance_cycle")
    private Integer maintenanceCycle;
    
    /**
     * 上次维护日期
     */
    @TableField("last_maintenance_date")
    private LocalDate lastMaintenanceDate;
    
    /**
     * 下次维护日期
     */
    @TableField("next_maintenance_date")
    private LocalDate nextMaintenanceDate;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
